/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.afcepf.projet2.test;

import java.util.logging.Level;
import java.util.logging.Logger;
import javaapplication2.webservice.Catalogue;
import javaapplication2.webservice.ExceptionCatalogue_Exception;
import javaapplication2.webservice.ExceptionCategorie_Exception;
import javaapplication2.webservice.ExceptionSiteInconnu_Exception;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author Sylvain
 */
public class CreationCatalogue {
    
    public CreationCatalogue() {
    }
    
    @BeforeClass
    public static void setUpClass() {
    }
    
    @AfterClass
    public static void tearDownClass() {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }
    // TODO add test methods here.
    // The methods must be annotated with annotation @Test. For example:
    //
     @Test
     public void creationCatalogueTest() throws ExceptionSiteInconnu_Exception, ExceptionSiteInconnu_Exception{
     Catalogue catalogue = new Catalogue();
            try {
                 catalogue = AppelsWebService.creationCatalogue("KingBoxIn");
             } catch (ExceptionSiteInconnu_Exception 
                     | ExceptionCatalogue_Exception 
                     | ExceptionCategorie_Exception ex) {
                 Logger.getLogger(CreationCatalogue.class.getName()).log(Level.SEVERE, null, ex);
        }
        assertTrue("Catalogue non vide", !catalogue.getCategorie().isEmpty());
     }
     
     @Test(expected=ExceptionSiteInconnu_Exception.class)
     public void erreurCreationCatalogue()throws ExceptionSiteInconnu_Exception{
     Catalogue catalogue = new Catalogue();
            try {
                 catalogue = AppelsWebService.creationCatalogue("");
             } catch (ExceptionCatalogue_Exception 
                     | ExceptionCategorie_Exception ex) {
                 Logger.getLogger(CreationCatalogue.class.getName()).log(Level.SEVERE, null, ex);
        }
        assertTrue("Catalogue non vide", !catalogue.getCategorie().isEmpty());
     }
}
